//
//  ShareFacebook.h
//  FB_skd
//
//  Created by Le Thanh Hai on 4/20/13.
//  Copyright (c) 2013 Le Thanh Hai. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Facebook.h"
#import "SBJSON.h"
#import "RankingList.h"
#import "InviteFriend.h"

typedef void(^FBHandler)(id data);
typedef void(^FBError)(id data);
typedef void (^HandleEvent)();

#define kFBRankingAccessToken    @"kFacebookAccessToken"
#define kFBRankingExpirationDate @"kFacebookExpirationDate"

@interface FacebookConnect : Facebook <FBRequestDelegate>
- (FBRequest*)requestWithGraphPath:(NSString *)graphPath
                         andParams:(NSMutableDictionary *)params
                     andHttpMethod:(NSString *)httpMethod
                         FBHandler:(FBHandler)data
                           fbError:(FBError)error;

@end

typedef enum {
    kStatusLogin
} Status;

@protocol ShareFacebookDelegate <NSObject>
@optional
-(void)fbDidLogin;

@end

@interface ShareFacebook : NSObject <FBSessionDelegate>
@property(nonatomic, retain) FacebookConnect *facebook;
@property(nonatomic, retain) NSArray *permissions;
@property(nonatomic, assign) id<ShareFacebookDelegate> delegate;
@property(nonatomic, copy) HandleEvent handler;
@property(nonatomic, copy) FBHandler fbHandler;

+(id)shareInstance;
+(BOOL)canUseFacebook;
-(BOOL)statusLogin;
-(void)authorize;
-(void)postScore:(int)score complete:(HandleEvent)handler;
-(void)getRankingList:(FBHandler)handler;
-(void)getAllFriend:(FBHandler)hander;
@end
